<template>
  <div class="healthInsuranceSelect">
    有无医保
    <span :class="{hIActive: !hasHI}" class="hINo" @click="selectHI(false)">无医保</span>
    <span :class="{hIActive: hasHI}" class="hIHas" @click="selectHI(true)">有医保</span>
  </div>
</template>

<script>
export default {
  name: 'healthInsuranceSelect',
  data () {
    return {
      hasHI: true
    }
  },
  methods: {
    selectHI (data) {
      if (this.hasHI !== data) {
        this.hasHI = data
        let type = 'T'
        if (!this.hasHI) {
          type = 'F'
        }
        this.$emit('getHealthInsurance', type)
      }
    }
  }
}
</script>

<style scoped>
  .healthInsuranceSelect {
    padding: 5px 15px;
    font-size: 14px;
    position: relative;
    color: #535353;
    line-height: 27px;
  }
  .hIHas {
    padding: 0 5px;
    height: 25px;
    border: 1px solid #c9c9c9;
    text-align: center;
    line-height: 27px;
    float: right;
    margin-right: 10px;
    border-radius: 3px;
    font-size: 14px;
  }
  .hINo {
    padding: 0 5px;
    height: 25px;
    border: 1px solid #c9c9c9;
    text-align: center;
    line-height: 27px;
    float: right;
    margin-right: 0px;
    border-radius: 3px;
    font-size: 14px;
  }
  .hIActive {
    color: #3f9aff;
    border: 1px solid #3f9aff;
  }
</style>
